home *** CD-ROM | disk | FTP | other *** search
/ Night Owl 6 / Night Owl's Shareware - PDSI-006 - Night Owl Corp (1990).iso / 039a / cppcom.zip / MODEM.HPP < prev    next >
C/C++ Source or Header  |  1991-04-14  |  2KB  |  67 lines

  1. /***************************************************************************
  2. These C++ classes are copyright 1990, by William Herrera.
  3. All those who put this code or its derivatives in a commercial product MUST
  4. mention this copyright in their documentation for users of the products in
  5. which this code or its derivative classes are used.  Otherwise, this code
  6. may be freely distributed and freely used for any purpose.
  7.  
  8. Enhancements: 1991 by David Orme
  9.     *  General cleanup.
  10.             - I/O now takes advantage of C++ overloading.
  11.             - Serial port I/O functionality now only in Serial class.
  12.             - Modem functionality now only in Modem class.
  13.     *  Possible to easily implement file Xfr prots now.
  14.     *  CCITT CRC-16 class added                            -- 2-20-1991
  15.     *  BIOS Timer class added                                -- 2-22-1991
  16.     *  Optional timeout on all input routines added    -- 2-25-1991
  17.  
  18. ***************************************************************************/
  19.  
  20. // file modem.hpp class declaration of modem class.
  21.  
  22. #ifndef MODEM_HPP
  23. #define MODEM_HPP 1
  24.                
  25. #include "serialpo.hpp"
  26.  
  27. extern const char inits[];
  28. extern const char tonedials[];
  29. extern const char pulsedials[];
  30. extern const char answers[];
  31. extern const char hangups[];
  32. extern const char resets[];
  33. extern const char returns[];
  34. extern const char escapes[];
  35. extern const char defaultcfgs[];
  36.  
  37.  
  38. class modem : public SerialPort
  39. {
  40. protected:
  41.     char * init;
  42.     char * tonedial;
  43.     char * pulsedial;
  44.     char * answer;
  45.     char * hangup;
  46.     char * reset;
  47.     char * retrn;
  48.     char * escape;
  49. public:
  50.     modem(int portnum = 1, int speed = 2400, 
  51.                     parity_t p = NOPAR, int sbits = 1, 
  52.                     int dbits = 8, boolean trans = false);
  53.     ~modem();
  54.     void ConfigureFromFile(const char * pathname = defaultcfgs);
  55.     void Initialize();
  56.     void Dial(char * number, boolean tone = true);
  57.     void HangUp();
  58.     void Answer();
  59.     void Escape();
  60.     void SendCommand(char * command);
  61. };
  62.  
  63. #endif
  64.  
  65.  
  66. // end of file modem.hpp
  67.